package com.customtouchevent;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;

import javax.security.auth.login.LoginException;

import static android.view.MotionEvent.ACTION_MOVE;


/**
 * @author Sandsboy
 * @description:广州皓醒科技有限公司
 * @date :2019/12/19 15:01
 */
public class TouchViewGroup extends ViewGroup {

    private String TAG = this.getClass().getName();

    public TouchViewGroup(Context context) {
        this(context, null);
    }

    public TouchViewGroup(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public TouchViewGroup(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init();
    }

    private void init() {
    }


    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {

    }


    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
//        boolean b = super.dispatchTouchEvent(ev);
        Log.i(TAG, "dispatchTouchEvent: " +ev.getAction() );
        return true;

    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        boolean b = super.onTouchEvent(event);
        Log.i(TAG, "onTouchEvent: " + b);
        return b;

    }
}
